<div id="dt_example">
    <div id="container">
        <div id="demo"
             <div style="font-size: 15px;font-style: oblique;font-weight: bold;margin-bottom: 10px;">Content Table</div>
             <div style="font-size: 15px;font-style: oblique;font-weight: bold;margin-bottom: 10px;margin: 20px;">
                 <a href ="#" onclick="load_link('index.php?page=CMS&action=createContent',loadCMSPage)">Create Content</a>
             </div>
            <table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
                <thead>
                    <tr>
                        <th>Name</th>
                        <th>Section Name </th>
                        <th>Section Type</th>
                        <th>Subsection Name </th>
                        <th>order</th>
                        <th>Status</th>
                        <th>Edit Content</th>
                    </tr>
                </thead>
                <tbody>
                    <?php
                    foreach($contents as $content){
                    echo"<tr>";
                        echo "<td>{$content->name}</td>";
                        echo "<td>{$content->subsection->section->name}</td>";
                        echo "<td>{$content->subsection->section->type->name}</td>";
                        echo "<td>{$content->subsection->name}</td>";
                        echo "<td>{$content->order_}</td>";
                        $status=$content->status_==0?'Closed':"Open";
                        echo "<td><a href='#' onclick='$(this).load(\"index.php\",\"page=CMS&action=changeStatus&module=section\")'>{$status}</a></td>";
                        echo "<td><a href ='#' onclick='load_link(\"index.php?page=CMS&action=createContent&id={$content->id}\",loadCMSPage)'>Edit</a></td>";
                    echo"</tr>";
                    }
                    ?>
                </tbody>
            </table>
        </div>
    </div>
</div>